home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / hardware / videot.arc / VIDEO_ID.DOC next >
Text File  |  1989-03-02  |  5KB  |  128 lines

  1. VIDEO_ID Detection Program  (c) 1989, Ed Tobias/Clyde McKenney
  2.  
  3. Often it is desirable to execute a particular version of a program
  4. based on the computer's hardware setup.  This is particularly true on
  5. a network, where many different computers, with different hardware,
  6. share the same programs.  For example, different versions of Windows
  7. are required which depend on a combination of the computer's video
  8. adapter, monitor, video ram, and whether or not a mouse is present. 
  9. Lotus requires different .SET files for each combination of hardware.
  10. Other programs such as Microsoft Word may require certain DOS 
  11. environment variables to be set to help them determine how to
  12. operate.
  13.  
  14. These parameters can be set for each workstation on the network in a
  15. variety of ways.  Some just use DOS SET in the user's login script -
  16. but that limits the user to one workstation type.  Some menu systems
  17. and remote-assist type programs store workstation-specific hardware
  18. data in a .DAT or .WKS file which is examined on startup.  In this
  19. case, the network supervisor must be careful to record each hardware
  20. change in a file somewhere (and maybe in multiple files), which in
  21. turn requires that the supervisor be aware of these hardware changes.
  22.  
  23. VIDEO_ID provides a quick way to determine, ON THE FLY, what hardware is
  24. present WITHIN a batch file, and branch to specific instructions
  25. (such as changing to a specific directory), or SET a DOS environment
  26. variable to a particular string accordingly.  It does this by setting
  27. the DOS ERRORLEVEL to a particular number, based on the parameter
  28. passed to VIDEO_ID and the hardware that VIDEO_ID detects.  The DOS
  29. ERRORLEVEL is a system setting which can be determined in a batch
  30. file through use of the IF ERRORLEVEL == statement.
  31.  
  32. The following parameters are available for testing:
  33.  
  34. [A]dapter - If invoked with an "a" or "A", VIDEO_ID sets the DOS ERRORLEVEL
  35.    as follows to indicate the type of video adapter present:
  36.  
  37.    1 - MDPA - Monochrone Display & Printer Adapter
  38.    2 - CGA  - Color Graphics Adapter
  39.    3 - EGA  - Enhanced Graphics Adapter
  40.    4 - VGA  - Video Graphics Array
  41.    5 - MCGA - Multi Color Graphics Array
  42.    6 - HGC  - Hercules Graphics Card
  43.    99 - could not determine
  44.  
  45. [D]isplay - If invoked with a "d" or "D", VIDEO_ID sets the DOS ERRORLEVEL
  46.    as follows to indicate the type of video display monitor present:
  47.  
  48.    1 - MONO       - monochrone display monitor
  49.    2 - COLOR      - color (or enhanced emulating color) display
  50.    3 - ENHCOLOR   - enhanced color display
  51.    4 - ANALOGMONO - Analog monochrome only display
  52.    5 - ANALOGCOLOR- Analog color only display
  53.    6 - ANALOG     - Analog monochrome and color display
  54.    99 - could not determine
  55.  
  56. [V]ideo RAM - If invoked with a "v" or "V", VIDEO_ID sets the DOS ERRORLEVEL 
  57.    as follows to indicate the amount of video RAM memory present:
  58.  
  59.    1 - 16K
  60.    2 - 32K
  61.    3 - 64K
  62.    4 - 128K
  63.    5 - 256K
  64.    6 - 512K
  65.    99 - could not determine
  66.  
  67. [S]ystem RAM - If invoked with an "s" or "S", VIDEO_ID sets the DOS
  68.    ERRORLEVEL as follows to indicate the amount of System Base RAM memory
  69.    present:
  70.  
  71.    1 - 256K
  72.    2 - 512K
  73.    3 - 640K
  74.    99 - could not determine
  75.  
  76.    If you know a particular program will bomb if there is not enough
  77.    memory present, this may help to prevent crashes.  Note that the
  78.    amount does NOT tell you how much memory is FREE, just how much is
  79.    present.
  80.  
  81. [C]omspec Drive - If invoked with a "c" or "C", VIDEO_ID sets the DOS
  82.    ERRORLEVEL as follows to indicate the current drive COMSPEC is mapped to:
  83.  
  84.    1 - A
  85.    2 - B
  86.    3 - C
  87.    4 - D
  88.    5 - E
  89.    6 - F
  90.    7....26 = g....z
  91.    99 - comspec drive could not be determined
  92.  
  93.    This may be useful in login scripts to decide whether to reset the
  94.    comspec to a network drive, if the computer was booted from a
  95.    floppy, etc.
  96.  
  97. [M]ouse - If invoked with an "m" or "M", VIDEO_ID sets the DOS ERRORLEVEL
  98.    as follows to indicate the presence or absence of a mouse:
  99.  
  100.    1 - mouse present
  101.    2 - mouse absent
  102.  
  103.  
  104. Since there is only 1 ERRORLEVEL setting at any given time, VIDEO_ID must be
  105. called separately for each type of information desired.  Repeated
  106. calls may be required sometimes, to get all the information needed. 
  107. However, judicious batch file writing will help.  Rather than having 
  108. many branches with similar instructions, use an environment variable
  109. to concatenate the results.  See the following:
  110.  
  111. VIDEO_ID A
  112. IF ERRORLEVEL 3 SET VIDEOTYPE=EGA
  113. VIDEO_ID V
  114. IF ERRORLEVEL 1 SET VIDEOTYPE=%VIDEOTYPE%256
  115. CD \WINDOWS\%VIDEOTYPE%
  116. WIN
  117. SET VIDEOTYPE=
  118.  
  119.  
  120. Please note that when testing for the DOS ERRORLEVEL in a batch file,
  121. values greater than or equal to that specified will all evaluate as
  122. true.  In other words, if the DOS ERRORLEVEL is set to 4, then the batch
  123. file statement "IF ERRORLEVEL == 1" evaluates as true.
  124.  
  125. Comments and suggestions regarding this program are welcome.  Please
  126. forward comments via Easyplex to CompuServe ID 75410,2026.
  127.  
  128.